package com.day13;

public class Test2 {
    public static void main(String[] args) {
        //自增
        int i=1;
        System.out.println("自增");
        System.out.println("i= "+i);//1
        System.out.println("++i= "+(++i));//2
        System.out.println("i= "+i);//2
        System.out.println("i++= "+(i++));//2
        System.out.println("i= "+i);//3

        //自减
        int i2=7;
        System.out.println("自减");
        System.out.println("i2= "+i2);//7
        System.out.println("--i2= "+(--i2));//6
        System.out.println("i2= "+i2);//6
        System.out.println("i2--= "+(i2--));//6
        System.out.println("i2= "+i2);//5
    }
}
